import { request } from 'umi';
const postApiList = [
  //网络安全信息
  '/notification/dispose/getNotificationList', //首页列表数据

  '/notification/dispose/addNotification', //新增安全事件
  '/notification/dispose/showServiceProviderList', //接收单位列表
  '/notification/dispose/dictItemList', //字典列表
  '/notification/dispose/fileUpload', //上传文件
  '/notification/dispose/showJjt', //查看
  '/notification/dispose/updateSecurityNotification', //单位处置
  '/notification/dispose/showDanWei', //省厅进入查看后的查看接口

  '/notification/dispose/updateNotification', //编辑
  '/notification/dispose/delNotification', //删除
  '/notification/dispose/cuiBanJtt', //催办

  '/unit/management/getAllOrg', //组织树查询接口
];
const API = {};
postApiList.forEach((item) => {
  // 使用正则取到接口路径的最后一个子串，比如: getPublicKey
  const apiName = /[^/]+$/.exec(item)[0];
  if (apiName) {
    API[apiName] = (data = {}) => {
      return request(item, {
        method: 'post',
        data,
      });
    };
  }
});
export default API;
